package com.love.travel.service.impl;

import java.util.List;
import com.love.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.love.travel.mapper.TravelItineraryAttractionMapper;
import com.love.travel.domain.TravelItineraryAttraction;
import com.love.travel.service.ITravelItineraryAttractionService;

/**
 * 行程-景点关联Service业务层处理
 * 
 * @author love
 * @date 2025-10-24
 */
@Service
public class TravelItineraryAttractionServiceImpl implements ITravelItineraryAttractionService 
{
    @Autowired
    private TravelItineraryAttractionMapper travelItineraryAttractionMapper;

    /**
     * 查询行程-景点关联
     * 
     * @param id 行程-景点关联主键
     * @return 行程-景点关联
     */
    @Override
    public TravelItineraryAttraction selectTravelItineraryAttractionById(Long id)
    {
        return travelItineraryAttractionMapper.selectTravelItineraryAttractionById(id);
    }

    /**
     * 查询行程-景点关联列表
     * 
     * @param travelItineraryAttraction 行程-景点关联
     * @return 行程-景点关联
     */
    @Override
    public List<TravelItineraryAttraction> selectTravelItineraryAttractionList(TravelItineraryAttraction travelItineraryAttraction)
    {
        return travelItineraryAttractionMapper.selectTravelItineraryAttractionList(travelItineraryAttraction);
    }

    /**
     * 新增行程-景点关联
     * 
     * @param travelItineraryAttraction 行程-景点关联
     * @return 结果
     */
    @Override
    public int insertTravelItineraryAttraction(TravelItineraryAttraction travelItineraryAttraction)
    {
        travelItineraryAttraction.setCreateTime(DateUtils.getNowDate());
        return travelItineraryAttractionMapper.insertTravelItineraryAttraction(travelItineraryAttraction);
    }

    /**
     * 修改行程-景点关联
     * 
     * @param travelItineraryAttraction 行程-景点关联
     * @return 结果
     */
    @Override
    public int updateTravelItineraryAttraction(TravelItineraryAttraction travelItineraryAttraction)
    {
        return travelItineraryAttractionMapper.updateTravelItineraryAttraction(travelItineraryAttraction);
    }

    /**
     * 批量删除行程-景点关联
     * 
     * @param ids 需要删除的行程-景点关联主键
     * @return 结果
     */
    @Override
    public int deleteTravelItineraryAttractionByIds(Long[] ids)
    {
        return travelItineraryAttractionMapper.deleteTravelItineraryAttractionByIds(ids);
    }

    /**
     * 删除行程-景点关联信息
     * 
     * @param id 行程-景点关联主键
     * @return 结果
     */
    @Override
    public int deleteTravelItineraryAttractionById(Long id)
    {
        return travelItineraryAttractionMapper.deleteTravelItineraryAttractionById(id);
    }
}
